<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="../../jQuery/jquery-3.4.1.js"></script>
		<script type="text/javascript">
			$(function(){
				var a=$("input:checked").val()
				alert(a)
			})
		</script>
	</head>
	<body>
		<p>喜欢的水果是？ <br>
			<label><input type="checkbox"/ value="苹果">苹果</label>
			<label><input type="checkbox"/value="蜜桃" checked="checked">蜜桃</label>
			<label><input type="checkbox"/value="西瓜">西瓜</label>
			<label><input type="checkbox"/value="梨子">梨子</label>
		</p>
	</body>
</html>
